/*
 *
 *      Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: lengleng (wangiegie@gmail.com)
 *
 */

package com.pig4cloud.pig.admin.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bblocks.util.R;
import com.pig4cloud.pig.admin.api.entity.SysArea;
import com.pig4cloud.pig.admin.api.entity.SysDept;
import com.pig4cloud.pig.admin.api.vo.DeptExcelVO;
import com.pig4cloud.pig.admin.api.vo.OrgTreeVO;
import org.springframework.validation.BindingResult;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 区域管理 服务类
 * </p>
 *
 * @author Jin
 * @since 2024-01-20
 */
public interface SysAreaService extends IService<SysArea> {

	/**
	 * 获取子集
	 * @param parentCode
	 * @return
	 */
	List<SysArea> getByParentCode(String parentCode);

	/**
	 * 根据code获取
	 * @param code
	 * @return
	 */
	SysArea getByCode(String code);

	SysArea get(Long id);

	/**
	 * 获取等级数据（按拼音首字母排序）
	 * @param lv 等级：1-省，2-市，3-区/县，4-街道/镇 5-社区/村
	 * @return
	 */
	List<SysArea> getByLv(int lv);

	/**
	 * 同步地区数据(1-4)
	 * @param maxLv 0-4 ，分别采集：省(0)、市(1)、区/县(2)，乡镇(3),街道/村(4)
	 */
	 void initAllByNet(int maxLv);

}
